import java.io.File;
import java.util.ArrayList;
import java.util.List;

public class DevelopmentMethod extends OriginalMethod {

    public void Cut(File FileName,File target){
        super.Copy(FileName,target);
        FileName.delete();
    }

    public void CopeUp(File FileName,File target){
        List<File> files = new ArrayList<>();
        File Target;
        int j = 0;
        if (FileName.isDirectory()){
            files = super.GetPath(FileName);
            for (char i : String.valueOf(FileName).toCharArray()){
                if (i == '\\'){
                    j++;
                }
            }
            if (j >= 3){
                StringBuffer ChildPath = new StringBuffer();
                ChildPath.append(String.valueOf(FileName));
                ChildPath.delete(0,ChildPath.lastIndexOf("\\"));
                for (File file : files){
                    file = super.GetChildPath(file,ChildPath);
                }
            }
        }
        for (File file : files) {
            if (!file.isDirectory()) {
                Target = super.CreatNewFileName(file,target);
                super.CreatNewFile(Target);
                super.Copy(file,Target);
            }
        }
    }
}
